package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.domain.entity.TObstacle;
import com.ruoyi.system.mapper.ObstacleDataMapper;
import com.ruoyi.system.service.IObstacleDataService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Auther: Stanley.Y
 * @Date: 2024/7/8
 * @Description:
 * @Version 1.0.0
 */
@Service
public class ObstacleDataServiceImpl implements IObstacleDataService {
    private static final Logger log = LoggerFactory.getLogger(ObstacleDataServiceImpl.class);

    @Autowired
    private ObstacleDataMapper obstacleDataMapper;

    @Override
    public List<TObstacle> getObstacleDataList() {
        List<TObstacle> result = obstacleDataMapper.getObstacleDataList();
        return result;
    }

    /**
     * 查询障碍物信息
     *
     * @param id 障碍物数据ID
     * @return 障碍物信息
     */
    @Override
    public TObstacle selectObstacleDataById(String id) {
        return obstacleDataMapper.selectObstacleDataById(id);
    }

    /**
     * 查询障碍物数据列表
     *
     * @param obstacle 障碍物数据对象
     * @return 障碍物数据集合
     */
    @Override
    public List<TObstacle> selectObstacleDataList(TObstacle obstacle) {
        return obstacleDataMapper.selectObstacleDataList(obstacle);
    }

    /**
     * 新增障碍物数据
     *
     * @param obstacle 障碍物数据对象
     * @return 新增处理结果
     */
    @Override
    public int insertObstacleData(TObstacle obstacle) {
        return obstacleDataMapper.insertObstacleData(obstacle);
    }

    /**
     * 修改障碍物数据
     *
     * @param obstacle 障碍物数据对象
     * @return 修改处理结果
     */
    @Override
    public int updateObstacleData(TObstacle obstacle) {
        return obstacleDataMapper.updateObstacleData(obstacle);
    }

    /**
     * 删除障碍物数据对象
     *
     * @param id 障碍物数据id
     * @return 删除操作结果
     */
    @Override
    public int deleteObstacleDataById(String id) {
        return obstacleDataMapper.deleteObstacleDataById(id);
    }

    /**
     * 批量删除障碍物信息
     *
     * @param ids 需要删除的障碍物数据id
     * @return 批量删除处理结果
     */
    @Override
    public int deleteObstacleDataByIds(String[] ids) {
        return obstacleDataMapper.deleteObstacleDataByIds(ids);
    }
}
